$(function () {
    //查询基本信息
    queryHealBasicInfo();
})
layui.use(['element' , 'form' , 'laydate', 'table' , 'layer'], function() {
    var element = layui.element;
    var form = layui.form;
    var laydate = layui.laydate;
    var table = layui.table;
    var layer = layui.layer;
});

//选中样式
$('.label-nav-con li').click(function() {
    $(this).addClass('current').siblings().removeClass('current');
})

//查询健康档案基本信息
function queryHealBasicInfo() {
    var userNo =$("#userNo").val();
    var str="";
    $.ajax({
        url:getRootPath_web()+'healthArchive/elderly/obtainOldManBasicInfo',
        type:'post',
        data:{"userNo":userNo},
        dataType:'json',
        success:function (result) {
            var b = result.archives;
            var h = result.history;
            var c = result.checkInfo;
            str+="<div>";
                str+="<div class=\"layui-tab layui-tab-child\" style=\"margin: 0;\">";
                    str+="<div class=\"layui-form\">";
                        str+="<ul class=\"layui-tab-title\">";
                            str+="<li class=\"layui-this\">基本信息</li>";
                            str+="<li>体格检查</li>";
                        str+="</ul>";
                    str+="</div> ";
                str+="<div class=\"layui-tab-content bgWhite\">";
                    str+="<div class=\"layui-tab-item layui-show\">";
                        str+="<article class=\"mb25px\">";
                            str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">个人信息</span></div>";
                            str+="<ul class=\"mess-details overflow lh32px\">";
                                str+="<li>";
                                    str+="<span>住院编号：</span>";
                                    str+="<em>"+testParameter(b.inNo)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                    str+="<span>工作单位：</span>";
                                    str+="<em>"+testParameter(b.workPlace)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                    str+="<span>职业：</span>";
                                    str+="<em>"+testParameter(b.job)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                    str+="<span>性别：</span><em>";
                                        if(b.sex=='1'){
                                            str+="男";
                                        }else if(b.sex=='2'){
                                            str+="女";
                                        }else{
                                            str+="暂无";
                                        }
                                    str+="</em>";
                                str+="</li>";
                                str+="<li>";
                                    str+="<span>年龄：</span>";
                                    str+="<em>"+testParameter(b.age)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                    str+="<span>民族：</span>";
                                    str+="<em>"+testParameter(b.nationName)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>出生地：</span>";
                                str+="<em>"+testParameter(b.birthPlace)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>入院时间：</span>";
                                str+="<em>"+testParameter(b.inDate)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>供史者：</span>";
                                str+="<em>"+testParameter(b.historyInfo)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>可靠程度：</span>";
                                str+="<em>"+testParameter(b.reliableDegree)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>病史采集时间：</span>";
                                str+="<em>"+testParameter(b.collectDate)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>主诉：</span>";
                                str+="<em>"+testParameter(b.zhuSu)+"</em>";
                                str+="</li>";
                                str+="</li>";
                                str+="<li class=\"three-width\">";
                                str+="<span>家庭住址：</span>";
                                str+="<em>"+testParameter(b.address)+"</em>";
                                str+="</li>";
                                str+="<li class=\"three-width\">";
                                str+="<span>现病史：</span>";
                                str+="<em>"+testParameter(b.medicalHistory)+"</em>";
                                str+="</li>";
                                str+="<li class=\"three-width\">";
                                str+="<span>既往史：</span>";
                                    if(b.jwHistory=='101'){
                                        str+="<em>健康</em>";
                                    }else if(b.jwHistory=='102'){
                                        str+="<em>一般</em>";
                                    }else if(b.jwHistory=='103'){
                                        str+="<em>差</em>";
                                    }else {
                                        str+="<em>暂无</em>";
                                    }
                                str+="</li>";
                                str+="<li class=\"three-width\">";
                                str+="<span>曾患疾病：</span>";
                                str+="<em>"+testParameter(b.diseaseInfo)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>传染病：</span>";
                                    if(b.infectiousDisease=='0'){
                                        str+="<em>无</em>";
                                    }else if(b.infectiousDisease=='1'){
                                        str+="<em>有</em>";
                                    }else {
                                        str+="<em>未知</em>";
                                    }
                                str+="</li>";
                                str+="<li>";
                                str+="<span>手术史：</span>";
                                        if(b.operationHistory=='0'){
                                            str+="<em>无</em>";
                                        }else if(b.operationHistory=='1'){
                                            str+="<em>有</em>";
                                        }else {
                                            str+="<em>未知</em>";
                                        }
                                str+="</li>";
                                str+="<li>";
                                str+="<span>手术部位：</span>";
                                str+="<em>"+testParameter(b.operationInfo)+"</em>";
                                str+="</li>";
                                str+="<li>";
                                str+="<span>食物、药物过敏史：</span>";
                                if(b.allergyHistory=='0'){
                                    str+="<em>无</em>";
                                }else if(b.allergyHistory=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                                str+="</li>";
                                str+="<li class='two-width'>";
                                str+="<span>重要药物应用史：</span>";
                                if(b.importHistory=='0'){
                                    str+="<em>无</em>";
                                }else if(b.importHistory=='1'){
                                    if(b.importInfo!=null){
                                        var importArray = new Array();
                                        if(b.importInfo.indexOf("1") != -1){
                                            importArray.push("激素");
                                        }
                                        if(b.importInfo.indexOf("2") != -1){
                                            importArray.push("抗癌药");
                                        }
                                        if(b.importInfo.indexOf("3") != -1){
                                            importArray.push("其他");
                                        }
                                    }
                                    str+="<em>"+importArray.toString()+"</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                                str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">个人史</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>文化程度：</span>";
                            str+="<em>"+testParameter(h.eductionName)+"</em>";
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>疫区疫水接触史：</span>";
                            if(h.isContact=='0'){
                                str+="<em>无</em>";
                            }else if(h.isContact=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>嗜烟：</span>";
                            if(h.isSmoke=='0'){
                                str+="<em>无</em>";
                            }else if(h.isSmoke=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>已抽烟年数：</span>";
                            str+="<em>"+testParameter(h.smokeYear)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>平均（支/日）：</span>";
                            str+="<em>"+testParameter(h.smokeCount)+"</em>";
                            str+="</li>";
                            str+="<li class='three-width'>";
                            str+="<span>已戒烟：</span>";
                            str+="<em>"+testParameter(h.quitSmokeYear)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>嗜酒：</span>";
                            if(h.drinkWine=='0'){
                                str+="<em>无</em>";
                            }else if(h.drinkWine=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>平均（两/日）：</span>";
                            str+="<em>"+testParameter(h.drinkCount)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>特殊癖好：</span>";
                            if(h.specialLike=='0'){
                                str+="<em>无</em>";
                            }else if(h.specialLike=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>婚姻：</span>";
                            str+="<em>"+testParameter(h.marriage)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>配偶：</span>";
                            if(h.spouse=='1'){
                                str+="<em>健康</em>";
                            }else if(h.spouse=='2'){
                                str+="<em>一般</em>";
                            }else if(h.spouse=='3'){
                                str+="<em>差</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>夫妻关系：</span>";
                            if(h.marriageRelationship=='0'){
                                str+="<em>欠佳</em>";
                            }else if(h.marriageRelationship=='1'){
                                str+="<em>和睦</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>月经初潮：</span>";
                            str+="<em>"+testParameter(h.menstruationStart)+"</em>";
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>月经绝经：</span>";
                            str+="<em>"+testParameter(h.menstruationEnd)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>子女：</span>";
                            str+="<em>"+testParameter(h.childrenCount)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>子：</span>";
                            str+="<em>"+testParameter(h.boyCount)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>女：</span>";
                            str+="<em>"+testParameter(h.girlCount)+"</em>";
                            str+="</li>";
                            str+="<li class='three-width'>";
                            str+="<span>子女关系：</span>";
                            if(h.childrenRelationship=='0'){
                                str+="<em>欠佳</em>";
                            }else if(h.childrenRelationship=='1'){
                                str+="<em>和睦</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>进食：</span>";
                            if(h.eatState=='0'){
                                str+="<em>依赖</em>";
                            }else if(h.eatState=='1'){
                                str+="<em>协助</em>";
                            }else if(h.eatState=='2'){
                                str+="<em>自理</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>个人卫生：</span>";
                            if(h.gygieneState=='0'){
                                str+="<em>依赖</em>";
                            }else if(h.gygieneState=='1'){
                                str+="<em>协助</em>";
                            }else if(h.gygieneState=='2'){
                                str+="<em>自理</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>行走：</span>";
                            if(h.runState=='0'){
                                str+="<em>依赖</em>";
                            }else if(h.runState=='1'){
                                str+="<em>协助</em>";
                            }else if(h.runState=='2'){
                                str+="<em>自理</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='three-width'>";
                            str+="<span>上下床：</span>";
                            if(h.inBedState=='0'){
                                str+="<em>依赖</em>";
                            }else if(h.inBedState=='1'){
                                str+="<em>协助</em>";
                            }else if(h.inBedState=='2'){
                                str+="<em>自理</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>饮食：</span>";
                            if(h.eatFood=='1'){
                                str+="<em>普食</em>";
                            }else if(h.eatFood=='2'){
                                str+="<em>半流</em>";
                            }else if(h.eatFood=='3'){
                                str+="<em>全流</em>";
                            }else if(h.eatFood=='4'){
                                str+="<em>特殊饮食</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>食欲：</span>";
                            if(h.appetite=='1'){
                                str+="<em>正常</em>";
                            }else if(h.appetite=='2'){
                                str+="<em>增加</em>";
                            }else if(h.appetite=='3'){
                                str+="<em>减退</em>";
                            }else if(h.appetite=='4'){
                                str+="<em>不思饮食</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>其他：</span>";
                            str+="<em>"+testParameter(h.eatOther)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>排便：</span>";
                            if(h.defecation!=null){
                                var defecationArray = new Array();
                                if(h.defecation.indexOf("1") != -1){
                                    defecationArray.push("正常");
                                }
                                if(h.defecation.indexOf("2") != -1){
                                    defecationArray.push("腹胀");
                                }
                                if(h.defecation.indexOf("3") != -1){
                                    defecationArray.push("便秘");
                                }
                                str+="<em>"+defecationArray.toString()+"</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>每日次数：</span>";
                            str+="<em>"+testParameter(h.defecationCount)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>其他：</span>";
                            str+="<em>"+testParameter(h.defecationOther)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>排尿：</span>";
                            if(h.micturition!=null&&h.micturition!=''){
                                var micturitionArray = new Array();
                                if(h.micturition.indexOf("1") != -1){
                                    micturitionArray.push("正常");
                                }
                                if(h.micturition.indexOf("2") != -1){
                                    micturitionArray.push("潴留");
                                }
                                if(h.micturition.indexOf("3") != -1){
                                    micturitionArray.push("失禁");
                                }
                                if(h.micturition.indexOf("4") != -1){
                                    micturitionArray.push("尿频");
                                }
                                if(h.micturition.indexOf("5") != -1){
                                    micturitionArray.push("尿急");
                                }
                                if(h.micturition.indexOf("6") != -1){
                                    micturitionArray.push("尿痛");
                                }
                                str+="<em>"+micturitionArray.toString()+"</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>其他：</span>";
                            str+="<em>"+testParameter(h.micturitionOther)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>睡眠：</span>";
                            if(h.sleepState=='0'){
                                str+="<em>失眠</em>";
                            }else if(h.sleepState=='1'){
                                str+="<em>正常</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>睡眠时长：</span>";
                            str+="<em>"+testParameter(h.sleepCount)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>辅助睡眠药物：</span>";
                            if(h.sleepDrug=='0'){
                                str+="<em>无</em>";
                            }else if(h.sleepDrug=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='width-two'>";
                            str+="<span>午睡：</span>";
                            if(h.noonSleep=='0'){
                                str+="<em>无</em>";
                            }else if(h.noonSleep=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>家族遗传病史：</span>";
                            str+="<em>"+testParameter(h.familyHistory)+"</em>";
                            str+="</li>";
                            str+="<li class='three-width'>";
                            str+="<span>备注：</span>";
                            str+="<em>"+testParameter(h.familyHistoryRemark)+"</em>";
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                str+="</div>";
                str+="<div class=\"layui-tab-item\">";
                    str+="<article class=\"mb25px\">";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>体温（℃）：</span>";
                            str+="<em>"+testParameter(c.temperature)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>脉搏（次数）：</span>";
                            str+="<em>"+testParameter(c.pulse)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>呼吸（次数）：</span>";
                            str+="<em>"+testParameter(c.breath)+"</em>";
                            str+="</li>";

                            str+="<li class='three-width'>";
                            str+="<span>血压（mmHg）：</span>";
                            str+="<em>"+testParameter(c.bloodPressure)+"</em>";
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">一般情况</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>进院：</span>";
                            if(c.admission=='1'){
                                str+="<em>步扶入</em>";
                            }else if(c.admission=='2'){
                                str+="<em>坐轮椅扶入</em>";
                            }else if(c.admission=='3'){
                                str+="<em>抬入</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                                str+="<span>神态：</span>";
                                if(c.mindStatus=='1'){
                                    str+="<em>清晰</em>";
                                }else if(c.mindStatus=='2'){
                                    str+="<em>模糊</em>";
                                }else if(c.mindStatus=='3'){
                                    str+="<em>不清</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>表情：</span>";
                                if(c.expression=='1'){
                                    str+="<em>正常</em>";
                                }else if(c.expression=='0'){
                                    str+="<em>不正常</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li class='three-width'>";
                            str+="<span>发育：</span>";
                                if(c.development=='1'){
                                    str+="<em>正常</em>";
                                }else if(c.development=='2'){
                                    str+="<em>欠佳</em>";
                                }else if(c.development=='3'){
                                    str+="<em>差</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>营养：</span>";
                                if(c.nutrition=='1'){
                                    str+="<em>良好</em>";
                                }else if(c.nutrition=='2'){
                                    str+="<em>中等</em>";
                                }else if(c.nutrition=='3'){
                                    str+="<em>不良</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>体型：</span>";
                                if(c.shape=='1'){
                                    str+="<em>消瘦</em>";
                                }else if(c.nutrition=='2'){
                                    str+="<em>肥胖</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>体位：</span>";
                                if(c.position=='1'){
                                    str+="<em>自动</em>";
                                }else if(c.position=='2'){
                                    str+="<em>被动</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>贫血貌：</span>";
                                if(c.anemia=='0'){
                                    str+="<em>无</em>";
                                }else if(c.anemia=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>查体：</span>";
                                if(c.chekBody=='0'){
                                    str+="<em>不合作</em>";
                                }else if(c.chekBody=='1'){
                                    str+="<em>合作</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                                str+="<span>对答切题：</span>";
                                if(c.answer=='0'){
                                    str+="<em>否</em>";
                                }else if(c.answer=='1'){
                                    str+="<em>是</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>语言障碍：</span>";
                                if(c.language=='0'){
                                    str+="<em>无</em>";
                                }else if(c.language=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">皮肤黏膜</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li class='two-width'>";
                            str+="<span>黄染：</span>";
                                if(c.yellow=='0'){
                                    str+="<em>无</em>";
                                }else if(c.yellow=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>瘀斑：</span>";
                                if(c.ecchymosis=='0'){
                                    str+="<em>无</em>";
                                }else if(c.ecchymosis=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>出血点：</span>";
                                if(c.bleedingInfo=='0'){
                                    str+="<em>无</em>";
                                }else if(c.bleedingInfo=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>出血部位：</span>";
                            str+="<em>"+testParameter(c.bleedingPlace)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>浮肿：</span>";
                                if(c.dropsy=='0'){
                                    str+="<em>无</em>";
                                }else if(c.dropsy=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>溃疡：</span>";
                            if(c.ulcer=='0'){
                                str+="<em>无</em>";
                            }else if(c.ulcer=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>褥疮：</span>";
                                if(c.bedsore=='0'){
                                    str+="<em>无</em>";
                                }else if(c.bedsore=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                                str+="<span>褥疮级别：</span>";
                                if(c.bedsoreType=='1'){
                                    str+="<em>I°</em>";
                                }else if(c.bedsoreType=='2'){
                                    str+="<em>II°</em>";
                                }else if(c.bedsoreType=='3'){
                                    str+="<em>III°</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>褥疮部位：</span>";
                            str+="<em>"+testParameter(c.bedsorePlace)+"</em>";
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">眼</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>眼睑充血：</span>";
                                if(c.blepharalHyperemia=='0'){
                                    str+="<em>无</em>";
                                }else if(c.blepharalHyperemia=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>对光反射：</span>";
                                if(c.reflectionLight=='0'){
                                    str+="<em>无</em>";
                                }else if(c.reflectionLight=='1'){
                                    str+="<em>有</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>角膜透明（左）：</span>";
                            if(c.leftEye=='0'){
                                str+="<em>否</em>";
                            }else if(c.leftEye=='1'){
                                str+="<em>是</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>角膜透明（右）：</span>";
                            if(c.rightEye=='0'){
                                str+="<em>否</em>";
                            }else if(c.rightEye=='1'){
                                str+="<em>是</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">耳</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li class='three-width'>";
                            str+="<span>听力：</span>";
                            if(c.hearing=='1'){
                                str+="<em>良好</em>";
                            }else if(c.hearing=='2'){
                                str+="<em>一般</em>";
                            }else if(c.rightEye=='3'){
                                str+="<em>差</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">鼻</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li class='three-width'>";
                            str+="<span>鼻唇沟对称：</span>";
                                if(c.nasolabialSulcus=='1'){
                                    str+="<em>是</em>";
                                }else if(c.nasolabialSulcus=='0'){
                                    str+="<em>否</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">口腔</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>伸舌：</span>";
                                if(c.tongueExtension=='1'){
                                    str+="<em>偏左</em>";
                                }else if(c.tongueExtension=='2'){
                                    str+="<em>居中</em>";
                                }else if(c.tongueExtension=='3'){
                                    str+="<em>偏右</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>口舌歪斜：</span>";
                                if(c.spat=='1'){
                                    str+="<em>有</em>";
                                }else if(c.spat=='0'){
                                    str+="<em>无</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>口唇紫绀：</span>";
                                if(c.lips=='1'){
                                    str+="<em>有</em>";
                                }else if(c.lips=='0'){
                                    str+="<em>无</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">浅表淋巴结</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>肿大：</span>";
                                if(c.lymphGland=='1'){
                                    str+="<em>有</em>";
                                }else if(c.lymphGland=='0'){
                                    str+="<em>无</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>部位：</span>";
                            str+="<em>"+testParameter(c.lymphGlandPlace)+"</em>";
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">胸</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li class='three-width'>";
                            str+="<span>外形：</span>";
                            if(c.thorax=='1'){
                                str+="<em>正常</em>";
                            }else if(c.thorax=='2'){
                                str+="<em>畸形</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">心脏</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>心尖搏动部位：</span>";
                            str+="<em>"+testParameter(c.xjbobw)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>心率(次数)：</span>";
                            str+="<em>"+testParameter(c.heartRateCount)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>心率：</span>";
                                if(c.heartRate=='1'){
                                    str+="<em>规则</em>";
                                }else if(c.heartRate=='2'){
                                    str+="<em>不规则</em>";
                                }else if(c.heartRate=='3'){
                                    str+="<em>绝对不规则</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>心音：</span>";
                            if(c.heartSounds=='1'){
                                str+="<em>正常</em>";
                            }else if(c.heartSounds=='2'){
                                str+="<em>强</em>";
                            }else if(c.heartSounds=='3'){
                                str+="<em>弱</em>";
                            }else if(c.heartSounds=='4'){
                                str+="<em>不等</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>A2P2杂音：</span>";
                            if(c.a2p2Noise=='1'){
                                str+="<em>可闻</em>";
                            }else if(c.a2p2Noise=='0'){
                                str+="<em>不可闻</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>杂音部位：</span>";
                            str+="<em>"+testParameter(c.a2p2NoisePlace)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>性质：</span>";
                            str+="<em>"+testParameter(c.noiseNature)+"</em>";
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>性质：</span>";
                            str+="<em>"+testParameter(c.noiseDegree)+"</em>";
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">肺脏</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>听诊（呼吸音）：</span>";
                            if(c.breathSounds=='1'){
                                str+="<em>低</em>";
                            }else if(c.breathSounds=='2'){
                                str+="<em>清</em>";
                            }else if(c.breathSounds=='3'){
                                str+="<em>粗</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>干湿罗音：</span>";
                            if(c.wetSounds=='0'){
                                str+="<em>无</em>";
                            }else if(c.wetSounds=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>部位：</span>";
                            str+="<em>"+c.soundsPlace+"</em>";
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">腹部</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>外形：</span>";
                            if(c.abdomen=='1'){
                                str+="<em>平坦</em>";
                            }else if(c.abdomen=='2'){
                                str+="<em>隆起</em>";
                            }else if(c.abdomen=='3'){
                                str+="<em>凹陷</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>腹壁静脉显露：</span>";
                            if(c.fbjmxl=='0'){
                                str+="<em>无</em>";
                            }else if(c.fbjmxl=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>肌肉紧张：</span>";
                            if(c.muscleTension=='0'){
                                str+="<em>无</em>";
                            }else if(c.muscleTension=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>压痛：</span>";
                            if(c.pressPain=='0'){
                                str+="<em>无</em>";
                            }else if(c.pressPain=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>反跳痛：</span>";
                            if(c.reboundingPain=='0'){
                                str+="<em>无</em>";
                            }else if(c.reboundingPain=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>肿块：</span>";
                            if(c.bossing=='0'){
                                str+="<em>无</em>";
                            }else if(c.bossing=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>肿块部位：</span>";
                            str+="<em>"+c.bossingPlace+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>肝肋下：</span>";
                                if(c.underLiver=='0'){
                                    str+="<em>未及</em>";
                                }else if(c.underLiver=='1'){
                                    str+="<em>及</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>脾肋下：</span>";
                            if(c.underSpleen=='0'){
                                str+="<em>未及</em>";
                            }else if(c.underSpleen=='1'){
                                str+="<em>及</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>肠鸣音：</span>";
                            if(c.intestinesSound=='1'){
                                str+="<em>减轻</em>";
                            }else if(c.intestinesSound=='2'){
                                str+="<em>正常</em>";
                            }else if(c.intestinesSound=='3'){
                                str+="<em>亢进</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='three-width'>";
                            str+="<span>移动性浊音：</span>";
                            if(c.moveSound=='0'){
                                str+="<em>无</em>";
                            }else if(c.moveSound=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">肛门直肠外生殖器</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>外形：</span>";
                            if(c.anusOutline=='1'){
                                str+="<em>正常</em>";
                            }else if(c.anusOutline=='2'){
                                str+="<em>异常</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>痔疮：</span>";
                            if(c.haemorrhoids=='0'){
                                str+="<em>无</em>";
                            }else if(c.haemorrhoids=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>肛裂：</span>";
                            if(c.analFissure=='0'){
                                str+="<em>无</em>";
                            }else if(c.analFissure=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='three-width'>";
                            str+="<span>脱肛：</span>";
                            if(c.rectocele=='0'){
                                str+="<em>无</em>";
                            }else if(c.rectocele=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">脊柱、四肢</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>脊椎：</span>";
                            if(c.backbone=='2'){
                                str+="<em>畸形</em>";
                            }else if(c.backbone=='1'){
                                str+="<em>正常</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>四肢：</span>";
                                if(c.allFours=='2'){
                                    str+="<em>畸形</em>";
                                }else if(c.allFours=='1'){
                                    str+="<em>正常</em>";
                                }else {
                                    str+="<em>未知</em>";
                                }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>双手震颤：</span>";
                            if(c.shakingHands=='0'){
                                str+="<em>无</em>";
                            }else if(c.shakingHands=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li>";
                            str+="<span>下肢浮肿：</span>";
                            if(c.edemaLowerLimbs=='0'){
                                str+="<em>无</em>";
                            }else if(c.edemaLowerLimbs=='1'){
                                str+="<em>有</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>肌张力：</span>";
                            if(c.muscularTension=='1'){
                                str+="<em>正常</em>";
                            }else if(c.muscularTension=='2'){
                                str+="<em>升高</em>";
                            }else if(c.muscularTension=='3'){
                                str+="<em>减弱</em>";
                            }else {
                                str+="<em>未知</em>";
                            }
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">肌力</span></div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                            str+="<li>";
                            str+="<span>左上肢（级）：</span>";
                            str+="<em>"+testParameter(c.leftUp)+"</em>";
                            str+="</li>";
                            str+="<li class='two-width'>";
                            str+="<span>右上肢（级）：</span>";
                            str+="<em>"+testParameter(c.rightUp)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>左下肢（级）：</span>";
                            str+="<em>"+testParameter(c.leftDown)+"</em>";
                            str+="</li>";
                            str+="<li>";
                            str+="<span>右下肢（级）：</span>";
                            str+="<em>"+testParameter(c.rightDown)+"</em>";
                            str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                    str+="<article class=\"mb25px\">";
                        str+="<div class=\"new-add-title relative overflow mb15px\"><span class=\"ml15px\">神经系统</span></div>";
                        str+="<div class='pb10px fb'>生理反射</div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                        str+="<li>";
                        str+="<span>肱二肌反射：</span>";
                        str+="<em>"+testParameter(c.armMuscle)+"</em>";
                        str+="</li>";
                        str+="<li class='two-width'>";
                        str+="<span>膝反射：</span>";
                        str+="<em>"+testParameter(c.kneeReflex)+"</em>";
                        str+="</li>";
                        str+="<li class='three-width'>";
                        str+="<span>其他：</span>";
                        str+="<em>"+testParameter(c.reflexOther)+"</em>";
                        str+="</li>";
                        str+="</ul>";
                        str+="<div class='pb10px fb'>病理反射</div>";
                        str+="<ul class=\"mess-details overflow lh32px\">";
                        str+="<li>";
                        str+="<span>克氏症：</span>";
                        if(c.gDisease=='1'){
                            str+="<em>+</em>";
                        }else if(c.gDisease=='2'){
                            str+="<em>-</em>";
                        }else {
                            str+="<em>未知</em>";
                        }
                        str+="</li>";
                        str+="<li class='two-width'>";
                        str+="<span>巴氏症：</span>";
                        if(c.bDisease==1){
                            str+="<em>+</em>";
                        }else if(c.bDisease==2){
                            str+="<em>-</em>";
                        }else {
                            str+="<em>未知</em>";
                        }
                        str+="</li>";
                        str+="<li>";
                        str+="<span>其他：</span>";
                        str+="<em>"+testParameter(c.pathologyOther)+"</em>";
                        str+="</li>";
                        str+="</ul>";
                    str+="</article>";
                str+="</div>";
            str+="</div>";
            str+="<div class=\"btn-con textCenter mt30px\">";
                str+="<span onclick='updateOldManHealthyInfo()' class=\"btn-three cursor\">修改</span>";
            str+="</div>";
            $("#containInfo").empty();
            $("#containInfo").append(str);
        }
    })
}
//验证信息
function testParameter(parameter) {
    if(parameter!=null&&parameter!=''){
        return parameter;
    }else {
        return "未知";
    }
}
//查询血糖记录表格
function queryBloodSugarTable() {
    var userNo =$("#userNo").val();
    $("#containInfo").empty();
    var str="";
    str+="<div class=\"layui-tab-item layui-show\">";
        str+="<article>";
            str+="<div class=\"new-add-title relative overflow\">";
                str+="<span class=\"ml15px left\">近7次测量结果</span>";
                str+="<span class=\"right right-arrow green cursor\" style='font-size: 14px' onclick='queryBloodSugarInfo()'>显示所有数据<img src='"+getRootPath_web()+"static/img/icon_right_arrow.png'></span>";
            str+="</div>";
            str+="<div class=\"lh32px overflow add-btn-input mt20px mb20px\">";
                str+="<p class=\"left cursor\">";
                    str+="<span onclick='addBloodSugarInfo(1)' class=\"white border-radius4 bgGreen inline-block pl15px pr15px\"><img src='"+getRootPath_web()+"static/img/button_add.png'>新建</span>";
                str+="</p>";
            str+="</div>";
            str+="<div class=\"overflow\">";
                str+="<p class=\"left\">单位：mmhg</p>";
                str+="<p class=\"appeal right\">";
                    str+="<span><img src='"+getRootPath_web()+"static/img/xy_01.png'>标准参考线<em class=\"ml10px\">3.9-6.1</em></span>";
                    str+="<span><img src='"+getRootPath_web()+"static/img/xy_03.png'>血糖值</span>";
                str+="<p>";
            str+="</div>";
            str+="<div id=\"sugarData\" style=\"width: 100%; height: 400px; margin-bottom: 20px;\"></div>";
        str+="</article>";
    str+="</div>";
    $.ajax({
        url:getRootPath_web()+'/healthArchive/bloodSugar/obtainData',
        type:'post',
        dataType:'json',
        data:{"userNo":userNo,"pageNum":"1","pageSize":"7"},
        success:function (result) {
            if(result.totalRecord>0){
                $("#containInfo").append(str);
                var myChart = echarts.init(document.getElementById('sugarData'));
                var max =result.max;
                var dateList=[];
                var bloodSugarList=[];
                $.each(result.data,function (key,value) {
                    var time = value.dateTime;
                    var  bloodSugar= value.glucose;
                    dateList.push(time);
                    bloodSugarList.push(bloodSugar);
                })
                // 指定图表的配置项和数据
                var option = {
                    grid: {
                        top:'30',
                        left: '20',   //图表距边框的距离
                        right: '20',
                        bottom: '0',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        axisLabel: {
                            textStyle: {
                                color:'#333',
                                fontSize: 12,
                            },
                        },
                        axisTick:{
                            show:false  //去掉y轴刻度线
                        },
                        //坐标轴颜色
                        axisLine:{
                            show:false,
                        },
                        data: dateList.reverse()
                    },
                    yAxis: [
                        {
                            type: 'value',
                            min:2.8,
                            max:max,
                            interval:0.7,
                            splitLine: {
                                show: true ,
                                lineStyle: {
                                    color: 'rgba(0, 0, 0, 0.08)',
                                    width: '1'
                                }
                            },
                            axisLabel: {
                                textStyle: {
                                    color:'#333',
                                    fontSize: 12,
                                },

                            },

                            axisTick:{
                                show:false  //去掉y轴刻度线
                            },
                            //坐标轴颜色
                            axisLine:{
                                show:false,
                            },
                        },
                    ],
                    series: [{
                        name: '收缩压',
                        type: 'line',
                        markLine:{       //平均线设置
                            silent:true,    //true 去掉鼠标悬浮该线上的动画
                            symbol:'none',   //该线无样式
                            label:{
                                show:false     //该线上的值去掉
                            },
                            lineStyle:{        //设置该线样式
                                normal:{
                                    type:'solid',
                                    color:'#1C9399'
                                }
                            },
                            data:[{
                                yAxis:6.1,    //线的值
                            }]
                        },
                        label:{
                            show:true     //该线上的值去掉
                        },
                        color:'#FA675C',
                        data: bloodSugarList.reverse(),
                    },
                        {
                            name: '',
                            type: 'line',
                            markLine:{       //平均线设置
                                silent:true,    //true 去掉鼠标悬浮该线上的动画
                                symbol:'none',   //该线无样式
                                label:{
                                    show:false     //该线上的值去掉
                                },
                                lineStyle:{        //设置该线样式
                                    normal:{
                                        type:'solid',
                                        color:'#1C9399'
                                    }
                                },
                                data:[{
                                    yAxis:3.9,    //线的值
                                    name:'target',
                                }]
                            },
                            data: [],
                        },]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            }else {
                var emptyStr="<div class=\"layui-tab-item layui-show\">";
                    emptyStr+="<article>";
                    emptyStr+="<div class=\"new-add-title relative overflow\">";
                    emptyStr+="<span class=\"ml15px left\">近7次测量结果</span>";
                    emptyStr+="<span class=\"right right-arrow blue cursor\" style='font-size: 14px' onclick='queryBloodSugarInfo()'>显示所有数据<img src='"+getRootPath_web()+"static/img/icon_right_arrow.png'></span>";
                    emptyStr+="</div>";
                    emptyStr+="<div class=\"lh32px overflow add-btn-input mt20px mb20px\">";
                    emptyStr+="<p class=\"left cursor\">";
                    emptyStr+="<span onclick='addBloodSugarInfo(1)' class=\"white border-radius4 bgGreen inline-block pl15px pr15px\"><img src='"+getRootPath_web()+"static/img/button_add.png'>新建</span>";
                    emptyStr+="</p>";
                    emptyStr+="</div>";
                    emptyStr+="<dl class=\"textCenter\">";
                    emptyStr+="<dt><img src='"+getRootPath_web()+"static/img/kongTwo.png' alt=\"\"></dt>";
                    emptyStr+="<dd class=\"gray mt20px\">暂无数据</dd>";
                    emptyStr+="</dl>";
                    emptyStr+="</article>";
                emptyStr+="</div>";
                $("#containInfo").append(emptyStr);
            }
        }
    })
}
//查询血糖记录
function queryBloodSugarInfo() {
    $("#containInfo").empty();
    var str="<div class=\"layui-tab-item layui-show\">";
        str+="<article>";
        str+="<div class=\"new-add-title relative overflow\">";
            str+="<span class=\"ml15px left\">所有血糖记录</span>";
            str+="<span onclick='queryBloodSugarTable()' class=\"right right-arrow f14px green cursor\" style='font-size: 14px'>显示趋势图<img src='"+getRootPath_web()+"static/img/icon_right_arrow.png'></span>";
        str+="</div>";
        str+="<div class=\"pt25px pb25px border-bot1px lh32px overflow\">";
            str+="<p class=\"left\">时间范围：</p>";
            str+="<p class=\"left layui-time-img\">";
                str+="<span class=\"layui-input-inline\" style=\"width: 200px;\">";
                    str+="<input type=\"text\" style=\"width: 200px;\" id='startDate' placeholder=\"开始日期\" readonly class=\"layui-input time-img test-item\">";
                str+="</span>";
                str+="<span>&nbsp;至&nbsp;</span>";
                str+="<span class=\"layui-input-inline\" style=\"width: 200px;\">";
                    str+="<input type=\"text\" style=\"width: 200px;\" id='endDate' placeholder=\"结束日期\" readonly class=\"layui-input time-img\">";
                str+="</span>";
            str+="</p>";
            str+="<p class=\"left ml40px\"><span onclick='obtainBloodSugarData()' class=\"white border-radius4 bgGreen block pl20px pr20px mr20px cursor\">查&nbsp;询</span></p>";
        str+="</div>";
        str+="<div>";
            str+="<div class=\"lh32px overflow add-btn-input mt20px mb20px\">";
                str+="<p class=\"left cursor\">";
                    str+="<span onclick='addBloodSugarInfo(2)' class=\"white border-radius4 bgGreen inline-block pl15px pr15px mr20px\"><img src='"+getRootPath_web()+"static/img/button_add.png'>新建</span>";
                    str+="<span onclick='deleteBloodSugarInfo()' class=\"white border-radius4 bgRed inline-block pl15px pr15px\"><img src='"+getRootPath_web()+"static/img/icon_delete.png' style=\"vertical-align: -3px;\">批量删除</span>";
                str+="</p>";
                str+="<p class=\"right\">";
                    str+="<span>共有<em id='totalRecord' class=\"red fb ml5px mr5px\">0</em>条</span>";
                str+="</p>";
            str+="</div>";
            str+="<div class=\"border1px border-radius4 relative table-time\">";
                str+="<table class=\"layui-hide\" id=\"bloodSugar\" lay-filter=\"bloodSugar\"></table>";
            str+="</div>";
        str+="</div>"
        str+="</article>";
    str+="</div>";
    $("#containInfo").append(str);
    layui.use(['laydate'], function() {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#startDate',
            trigger: 'click',
        });
        laydate.render({
            elem: '#endDate',
            trigger: 'click',
        });
    });
    obtainBloodSugarData();
}
//查询血糖记录数据
function obtainBloodSugarData() {
    var userNo =$("#userNo").val();
    var startDate =$("#startDate").val();
    var endDate = $("#endDate").val();
    layui.use(['table' , 'layer'], function() {
        var table = layui.table;
        //第一个实例
        table.render({
            elem: '#bloodSugar'
            ,url: getRootPath_web()+'/healthArchive/bloodSugar/obtainData',
            method:'post',
            where:{userNo:userNo,startDate:startDate,endDate:endDate},
            request: {
                pageName: 'pageNum' //页码的参数名称，默认：page
                ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
            },
            parseData: function(res){
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.codeDesc, //解析提示文本
                    "count": res.totalRecord, //解析数据长度
                    "data": res.data //解析数据列表
                };
            },
            done:function(res){
                $("#totalRecord").html(res.count);
            },
            page: true //开启分页
            ,
            cols: [
                [ //表头
                    {
                        type: 'checkbox',
                        fixed: 'left'
                    },
                    {
                        field: 'order',
                        title: '编号',
                        fixed: 'left',
                        width:80,
                    }, {
                    field: 'glucose',
                    title: '血糖值（正常参考值：3.9-6.1  单位：mmol/L）',
                    templet: function(res){
                        var str="";
                        if(res.glucoseState=='3'){
                            str+="<div class='inline-block lift-con relative pl25px pr25px'>";
                                str+="<em class='one'><img src='"+getRootPath_web()+"static/img/icon_diyu.png'></em><span>"+res.glucose+"</span><em class='three'></em>";
                            str+="</di>"
                        }else if(res.glucoseState=='2'){
                            str+="<div class='inline-block lift-con relative pl25px pr25px'>"
                                str+="<em class='one'></em><span>"+res.glucose+"</span><em class='three'><img src='"+getRootPath_web()+"static/img/icon_gaoyu.png'></em>";
                            str+="</div>";
                        }else {
                            str+="<div class='inline-block lift-con relative pl25px pr25px'>"
                                str+="<em class='one'></em><span>"+res.glucose+"</span><em class='three'></em>";
                            str+="</div>";
                        }
                        return str;
                    }
                }, {
                    field: 'name',
                    title: '记录员',
                }, {
                    field: 'dateTime',
                    title: '记录时间',
                }
                ]
            ]
        });
    });
}
//添加血糖信息
function addBloodSugarInfo(type) {
    var str="<div class=\"pop-up\">";
    str+="<div>";
    str+="<div class=\"pop-title relative overflow mb15px\">";
    str+="<span class=\"ml15px\">新建记录</span>";
    str+="<p class=\"right closeBtn\" style='cursor: pointer'><img src='"+getRootPath_web()+"static/img/close_icon.png' class=\"block pop-close\"><p>";
    str+="</div>";
    str+="<form id='buildingForm'>";
    str+="<div class=\"pop-form mt30px mb30px\">";
    str+="<div class=\"layui-form-item\">";
    str+="<label class=\"layui-form-label\"><span class=\"red\">*</span>血糖值（mmol/L）</label>";
    str+="<div class=\"layui-input-block\">";
    str+="<input type=\"text\" maxlength='6' onkeyup=\"value=value.replace(/^\\D*(\\d*(?:\\.\\d{0,2})?).*$/g, '$1')\" placeholder=\"血糖值\" class=\"layui-input bloodSugarInfo\">";
    str+="</div>";
    str+="</div>";
    str+="</div>";
    str+="<div class=\"btn-con textCenter\">";
    str+="<span class=\"btn-two btn-submit cursor\">保&nbsp;存</span>";
    str+="</div>";
    str+="</div>";
    str+="</form>";
    str+="</div>";
    layui.use(['layer'], function() {
        var layer = layui.layer;
        layer.open({
            type: 1,
            title: false, //不显示标题栏
            closeBtn: false,
            area: ['500px', ''],
            shade: 0.6,
            id: 'payCons', //设定一个id，防止重复弹出
            /*,btn: ['确认支付']*/
            btnAlign: 'c',
            moveType: 1, //拖拽模式，0或者1
            shadeClose: false, //设置允许点遮罩关闭
            content: str,
            success: function() {
                //关闭弹层
                $(".closeBtn").click(function() {
                    layer.closeAll();
                });
                $(".btn-submit").click(function () {
                    saveBloodSugarInfo(type);
                })
            },
        });
    });
}
//保存血糖记录信息
function saveBloodSugarInfo(type) {
    layui.use('layer', function(){
        var layer = layui.layer;
        var userNo =$("#userNo").val();
        //血糖值
        var bloodSugarInfo=$(".bloodSugarInfo").val();
        if(bloodSugarInfo==''){
            layer.msg('血糖值不能为空！');
            return false;
        }
        //验证血糖值
        if(bloodSugarInfo<=0||bloodSugarInfo>50){
            layer.msg('血糖值必须大于0小于50！');
            return false;
        }
        var loading;
        // layer.confirm('确定添加吗？', {
        //     btn: ['确定','取消'] //按钮
        // }, function(){
        //
        // }, function(){
        //     layer.close(layer.index);
        // });
        $.ajax({
            url:getRootPath_web()
                +'healthArchive/bloodSugar/saveData',
            type:'post',
            data:{"userNo":userNo,"bloodGlucose":bloodSugarInfo},
            dataType:'json',
            beforeSend:function () {
                loading = layer.load(1, {
                    shade: [0.9,'#fff']
                    ,shadeClose:false
                });
            },
            success:function (result) {
                if(result.code=='0000'){
                    layer.confirm('添加成功', {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.closeAll();
                        if(type==1){
                            queryBloodSugarTable();
                        }else {
                            queryBloodSugarInfo();
                        }
                    })
                }else {
                    layer.confirm(result.codeDesc, {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.close(layer.index);
                        layer.close(loading);
                    })
                }
            }
        })
    });
}
//删除血糖数据信息
function deleteBloodSugarInfo(){
    layui.use('table', function(){
        var table = layui.table;
        var layer = layui.layer;
        //监听表格复选框选择
        table.on('checkbox(bloodSugar)', function(obj){
            console.log(obj)
        });
        //获取选中的值
        var checkStatus = table.checkStatus('bloodSugar')
            ,data = checkStatus.data;
        //获取选中的条数
        var dataLength = data.length;
        if(dataLength<=0){
            layer.msg("请选择要删除的数据！");
            return false;
        }
        var dateInfo = JSON.stringify(data);
        layer.confirm('确定删除这'+dataLength+'条记录吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:getRootPath_web()
                    +'healthArchive/bloodSugar/deleteData',
                type:'post',
                data:{"dataInfo":dateInfo},
                dataType:'json',
                success:function (result) {
                    if(result.code=='0000'){
                        layer.confirm('删除成功？', {
                            btn: ['确定','取消'] //按钮
                        }, function(){
                            layer.closeAll();
                            obtainBloodSugarData();
                        });
                    }else {
                        layer.msg(result.codeDesc);
                    }
                }
            })
        }, function(){
            layer.closeAll();
        });
    });
}


//查询血压记录表格
function queryBloodPressureTable() {
    var userNo =$("#userNo").val();
    $("#containInfo").empty();
    var str="";
    str+="<div class=\"layui-tab-item layui-show\">";
    str+="<article>";
    str+="<div class=\"new-add-title relative overflow\">";
    str+="<span class=\"ml15px left\">近7次测量结果</span>";
    str+="<span class=\"right right-arrow green cursor\" style='font-size: 14px' onclick='queryBloodPressureInfo()'>显示所有数据<img src='"+getRootPath_web()+"static/img/icon_right_arrow.png'></span>";
    str+="</div>";
    str+="<div class=\"lh32px overflow add-btn-input mt20px mb20px\">";
    str+="<p class=\"left cursor\">";
    str+="<span onclick='addBloodPressureInfo(1)' class=\"white border-radius4 bgGreen inline-block pl15px pr15px\"><img src='"+getRootPath_web()+"static/img/button_add.png'>新建</span>";
    str+="</p>";
    str+="</div>";
    str+="<div class=\"overflow\">";
    str+="<p class=\"left\">单位：mmhg</p>";
    str+="<p class=\"appeal right\">";
    str+="<span><img src='"+getRootPath_web()+"static/img/xy_01.png'>标准参考线<em class=\"ml10px\">90-140</em></span>";
    str+="<span><img src='"+getRootPath_web()+"static/img/xy_02.png'>收缩压</span>";
    str+="<span><img src='"+getRootPath_web()+"static/img/xy_03.png'>舒张压</span>";
    str+="<p>";
    str+="</div>";
    str+="<div id=\"pressureData\" style=\"width: 100%; height: 400px; margin-bottom: 20px;\"></div>";
    str+="</article>";
    str+="</div>";
    $.ajax({
        url:getRootPath_web()+'/healthArchive/bloodPressure/obtainData',
        type:'post',
        dataType:'json',
        data:{"userNo":userNo,"pageNum":"1","pageSize":"7"},
        success:function (result) {
            if(result.totalRecord>0){
                $("#containInfo").append(str);
                var myChart = echarts.init(document.getElementById('pressureData'));
                var max =result.max;
                var dateList=[];
                var diastolicList=[];
                var systolicList=[];
                $.each(result.data,function (key,value) {
                    var time = value.dateTime;
                    var diastolic= value.diastolic;
                    var systolic = value.systolic;
                    dateList.push(time);
                    diastolicList.push(diastolic);
                    systolicList.push(systolic);
                })
                // 指定图表的配置项和数据
                var option = {
                    grid: {
                        top:'30',
                        left: '20',   //图表距边框的距离
                        right: '20',
                        bottom: '0',
                        containLabel: true
                    },
                    xAxis: {
                        type: 'category',
                        axisLabel: {
                            textStyle: {
                                color:'#333',
                                fontSize: 12,
                            },
                        },
                        axisTick:{
                            show:false  //去掉y轴刻度线
                        },

                        //坐标轴颜色
                        axisLine:{
                            show:false,
                        },
                        data: dateList.reverse()
                    },
                    yAxis: [
                        {
                            type: 'value',
                            min:30,
                            max:190,
                            interval:10,
                            splitLine: {
                                show: true ,
                                lineStyle: {
                                    color: 'rgba(0, 0, 0, 0.08)',
                                    width: '1'
                                }
                            },
                            axisLabel: {
                                textStyle: {
                                    color:'#333',
                                    fontSize: 12,
                                },

                            },

                            axisTick:{
                                show:false  //去掉y轴刻度线
                            },
                            //坐标轴颜色
                            axisLine:{
                                show:false,
                            },
                        },
                    ],
                    series: [{
                        name: '收缩压',
                        type: 'line',
                        markLine:{       //平均线设置
                            silent:true,    //true 去掉鼠标悬浮该线上的动画
                            symbol:'none',   //该线无样式
                            label:{
                                show:false     //该线上的值去掉
                            },
                            data:[{
                                yAxis:140,    //线的值
                                lineStyle:{        //设置该线样式
                                    normal:{
                                        type:'solid',
                                        color:'#1C9399'
                                    }
                                },
                            }]
                        },
                        label:{
                            show:true     //该线上的值去掉
                        },
                        color:'#31A4FF',
                        lineStyle:{        //设置该线样式
                            normal:{
                                type:'solid',
                                color:'#31A4FF'
                            }
                        },
                        data: systolicList.reverse(),
                    },
                        {
                            name: '舒张压',
                            type: 'line',
                            markLine:{       //平均线设置
                                silent:true,    //true 去掉鼠标悬浮该线上的动画
                                symbol:'none',   //该线无样式
                                label:{
                                    show:false     //该线上的值去掉
                                },
                                data:[{
                                    yAxis:90,    //线的值
                                    lineStyle:{        //设置该线样式
                                        normal:{
                                            type:'solid',
                                            color:'#1C9399'
                                        }
                                    },
                                }]
                            },
                            label:{
                                show:true     //该线上的值去掉
                            },
                            color:'#FA675C',
                            lineStyle:{        //设置该线样式
                                normal:{
                                    type:'solid',
                                    color:'#FA675C'
                                }
                            },
                            data:diastolicList.reverse(),
                        },]
                };
                // 使用刚指定的配置项和数据显示图表。
                myChart.setOption(option);
            }else {
                var emptyStr="<div class=\"layui-tab-item layui-show\">";
                emptyStr+="<article>";
                emptyStr+="<div class=\"new-add-title relative overflow\">";
                emptyStr+="<span class=\"ml15px left\">近7次测量结果</span>";
                emptyStr+="<span class=\"right right-arrow green cursor\" style='font-size: 14px' onclick='queryBloodPressureInfo()'>显示所有数据<img src='"+getRootPath_web()+"static/img/icon_right_arrow.png'></span>";
                emptyStr+="</div>";
                emptyStr+="<div class=\"lh32px overflow add-btn-input mt20px mb20px\">";
                emptyStr+="<p class=\"left cursor\">";
                emptyStr+="<span onclick='addBloodPressureInfo(1)' class=\"white border-radius4 bgGreen inline-block pl15px pr15px\"><img src='"+getRootPath_web()+"static/img/button_add.png'>新建</span>";
                emptyStr+="</p>";
                emptyStr+="</div>";
                emptyStr+="<dl class=\"textCenter\">";
                emptyStr+="<dt><img src='"+getRootPath_web()+"static/img/kongTwo.png' alt=\"\"></dt>";
                emptyStr+="<dd class=\"gray mt20px\">暂无数据</dd>";
                emptyStr+="</dl>";
                emptyStr+="</article>";
                emptyStr+="</div>";
                $("#containInfo").append(emptyStr);
            }
        }
    })
}
//查询血压记录
function queryBloodPressureInfo() {
    $("#containInfo").empty();
    var str="<div class=\"layui-tab-item layui-show\">";
    str+="<article>";
    str+="<div class=\"new-add-title relative overflow\">";
    str+="<span class=\"ml15px left\">所有血压记录</span>";
    str+="<span onclick='queryBloodPressureTable()' class=\"right right-arrow f14px green cursor\" style='font-size: 14px'>显示趋势图<img src='"+getRootPath_web()+"static/img/icon_right_arrow.png'></span>";
    str+="</div>";
    str+="<div class=\"pt25px pb25px border-bot1px lh32px overflow\">";
    str+="<p class=\"left\">时间范围：</p>";
    str+="<p class=\"left layui-time-img\">";
    str+="<span class=\"layui-input-inline\" style=\"width: 200px;\">";
    str+="<input type=\"text\" id='startDate' style=\"width: 200px;\" placeholder=\"开始日期\" readonly class=\"layui-input time-img test-item\">";
    str+="</span>";
    str+="<span>&nbsp;至&nbsp;</span>";
    str+="<span class=\"layui-input-inline\" style=\"width: 200px;\">";
    str+="<input type=\"text\" id='endDate' style=\"width: 200px;\" placeholder=\"结束日期\" readonly class=\"layui-input time-img\">";
    str+="</span>";
    str+="</p>";
    str+="<p class=\"left ml40px\"><span onclick='obtainBloodPressureData()' class=\"white border-radius4 bgGreen block pl20px pr20px mr20px cursor\">查&nbsp;询</span></p>";
    str+="</div>";
    str+="<div>";
    str+="<div class=\"lh32px overflow add-btn-input mt20px mb20px\">";
    str+="<p class=\"left cursor\">";
    str+="<span onclick='addBloodPressureInfo(2)' class=\"white border-radius4 bgGreen inline-block pl15px pr15px mr20px\"><img src='"+getRootPath_web()+"static/img/button_add.png'>新建</span>";
    str+="<span onclick='deleteBloodPressureInfo()' class=\"white border-radius4 bgRed inline-block pl15px pr15px\"><img src='"+getRootPath_web()+"static/img/icon_delete.png' style=\"vertical-align: -3px;\">批量删除</span>";
    str+="</p>";
    str+="<p class=\"right\">";
    str+="<span>共有<em id='totalRecord' class=\"red fb ml5px mr5px\">0</em>条</span>";
    str+="</p>";
    str+="</div>";
    str+="<div class=\"border1px border-radius4 relative table-time\">";
    str+="<table class=\"layui-hide\" id=\"bloodPressure\" lay-filter=\"bloodPressure\"></table>";
    str+="</div>";
    str+="</div>"
    str+="</article>";
    str+="</div>";
    $("#containInfo").append(str);
    layui.use(['laydate'], function() {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#startDate',
            trigger: 'click',
        });
        laydate.render({
            elem: '#endDate',
            trigger: 'click',
        });
    });
    obtainBloodPressureData();
}
//查询血压记录数据
function obtainBloodPressureData() {
    var userNo =$("#userNo").val();
    var startDate =$("#startDate").val();
    var endDate = $("#endDate").val();
    layui.use(['table' , 'layer'], function() {
        var table = layui.table;
        //第一个实例
        table.render({
            elem: '#bloodPressure'
            ,url: getRootPath_web()+'/healthArchive/bloodPressure/obtainData',
            method:'post',
            where:{userNo:userNo,startDate:startDate,endDate:endDate},
            request: {
                pageName: 'pageNum' //页码的参数名称，默认：page
                ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
            },
            parseData: function(res){
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.codeDesc, //解析提示文本
                    "count": res.totalRecord, //解析数据长度
                    "data": res.data //解析数据列表
                };
            },
            done:function(res){
                $("#totalRecord").html(res.count);
            },
            page: true //开启分页
            ,
            cols: [
                [ //表头
                    {
                        type: 'checkbox',
                        fixed: 'left'
                    },
                    {
                        field: 'order',
                        title: '编号',
                        fixed: 'left',
                        width:80,
                    }, {
                    field: 'pressure',
                    title: '血压值（正常参考值：90-140  单位：mmlHg）',
                    templet: function(res){
                        var str="";
                        str+="<div class='inline-block lift-con relative pl25px pr25px'>";
                        if(res.diastolic<60){
                            str+="<em class='one'><img src='"+getRootPath_web()+"static/img/icon_diyu.png'></em>";
                        }else {
                            str+="<em class='one'></em>";
                        }
                        str+="<span>"+res.pressure+"</span>";
                        if(res.systolic>140){
                            str+="<em class='three'><img src='"+getRootPath_web()+"static/img/icon_gaoyu.png'></em>";
                        }else{
                            str+="<em class='three'></em>";
                        }
                        return str;
                    }
                }, {
                    field: 'name',
                    title: '记录员',
                }, {
                    field: 'dateTime',
                    title: '记录时间',
                }
                ]
            ]
        });
    });
}
//添加血压信息
function addBloodPressureInfo(type) {
    var str="<div class=\"pop-up\">";
    str+="<div>";
    str+="<div class=\"pop-title relative overflow mb15px\">";
    str+="<span class=\"ml15px\">新建记录</span>";
    str+="<p class=\"right closeBtn\" style='cursor: pointer'><img src='"+getRootPath_web()+"static/img/close_icon.png' class=\"block pop-close\"><p>";
    str+="</div>";
    str+="<div class=\"pop-form mt30px mb30px\">";
    str+="<div class=\"layui-form-item\">";
    str+="<label class=\"layui-form-label\"><span class=\"red\">*</span>收缩压（mmHg）</label>";
    str+="<div class=\"layui-input-block\">";
    str+="<input type=\"text\" maxlength='3' oninput = \"value=value.replace(/[^\\d]/g,'')\" placeholder=\"收缩压\" class=\"layui-input systolicPressure\">";
    str+="</div>";
    str+="<div class=\"pop-form mt30px mb30px\">";
    str+="<div class=\"layui-form-item\">";
    str+="<label class=\"layui-form-label\"><span class=\"red\">*</span>舒张压（mmHg）</label>";
    str+="<div class=\"layui-input-block\">";
    str+="<input type=\"text\" maxlength='3' oninput = \"value=value.replace(/[^\\d]/g,'')\" placeholder=\"舒张压\" class=\"layui-input diastolicPressure\">";
    str+="</div>";

    str+="</div>";
    str+="</div>";
    str+="<div class=\"btn-con textCenter\">";
    str+="<span class=\"btn-two btn-submit cursor\">保&nbsp;存</span>";
    str+="</div>";
    str+="</div>";
    str+="</div>";
    layui.use(['layer'], function() {
        var layer = layui.layer;
        layer.open({
            type: 1,
            title: false, //不显示标题栏
            closeBtn: false,
            area: ['500px', ''],
            shade: 0.6,
            id: 'payCons', //设定一个id，防止重复弹出
            /*,btn: ['确认支付']*/
            btnAlign: 'c',
            moveType: 1, //拖拽模式，0或者1
            shadeClose: false, //设置允许点遮罩关闭
            content: str,
            success: function() {
                //关闭弹层
                $(".closeBtn").click(function() {
                    layer.closeAll();
                });
                $(".btn-submit").click(function () {
                    saveBloodPressureInfo(type);
                })
            },
        });
    });
}
//保存血压记录信息
function saveBloodPressureInfo(type) {
    layui.use('layer', function(){
        var layer = layui.layer;
        var userNo =$("#userNo").val();
        //收缩压
        var systolicPressure=$(".systolicPressure").val();
        if(systolicPressure==''){
            layer.msg('收缩压不能为空！');
            return false;
        }
        //验证收缩压
        if(systolicPressure<=0||systolicPressure>230){
            layer.msg('收缩压必须大于0小于230！');
            return false;
        }
        //舒张压
        var diastolicPressure=$(".diastolicPressure").val();
        if(diastolicPressure==''){
            layer.msg('舒张压不能为空！');
            return false;
        }
        //验证收缩压
        if(diastolicPressure<=30||diastolicPressure>140){
            layer.msg('舒张压必须大于30小于140！');
            return false;
        }
        if(parseInt(systolicPressure) <=parseInt(diastolicPressure)){
            layer.msg('收缩压必须大于舒张压！');
            return false;
        }
        var loading;
        // layer.confirm('确定添加吗？', {
        //     btn: ['确定','取消'] //按钮
        // }, function(){
        //
        // }, function(){
        //     layer.close(layer.index);
        // });
        $.ajax({
            url:getRootPath_web()
                +'healthArchive/bloodPressure/saveData',
            type:'post',
            data:{"userNo":userNo,"systolicPressure":systolicPressure,"diastolicPressure":diastolicPressure},
            dataType:'json',
            beforeSend:function () {
                loading = layer.load(1, {
                    shade: [0.9,'#fff']
                    ,shadeClose:false
                });
            },
            success:function (result) {
                if(result.code=='0000'){
                    layer.confirm('添加成功', {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.closeAll();
                        if(type==1){
                            queryBloodPressureTable();
                        }else {
                            queryBloodPressureInfo();
                        }
                    })
                }else {
                    layer.confirm(result.codeDesc, {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.close(layer.index);
                        layer.close(loading);
                    })
                }
            }
        })
    });
}
//删除血压数据信息
function deleteBloodPressureInfo(){
    layui.use('table', function(){
        var table = layui.table;
        var layer = layui.layer;
        //监听表格复选框选择
        table.on('checkbox(bloodPressure)', function(obj){
            console.log(obj)
        });
        //获取选中的值
        var checkStatus = table.checkStatus('bloodPressure')
            ,data = checkStatus.data;
        //获取选中的条数
        var dataLength = data.length;
        if(dataLength<=0){
            layer.msg("请选择要删除的数据！");
            return false;
        }
        var dateInfo = JSON.stringify(data);
        layer.confirm('确定删除这'+dataLength+'条记录吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:getRootPath_web()
                    +'healthArchive/bloodPressure/deleteData',
                type:'post',
                data:{"dataInfo":dateInfo},
                dataType:'json',
                success:function (result) {
                    if(result.code=='0000'){
                        layer.confirm('删除成功？', {
                            btn: ['确定','取消'] //按钮
                        }, function(){
                            layer.closeAll();
                            obtainBloodPressureData();
                        });
                    }else {
                        layer.msg(result.codeDesc);
                    }
                }
            })
        }, function(){
            layer.closeAll();
        });
    });
}


//查询护理评估记录
function queryNursingInfo() {
    $("#containInfo").empty();
    var str="<div class=\"layui-tab-item layui-show\">";
    str+="<article>";
    str+="<div>";
    str+="<div class=\"lh32px overflow add-btn-input mt20px mb20px\">";
    str+="<p class=\"left cursor\">";
    str+="<span onclick='addNursingInfo()' class=\"white border-radius4 bgGreen inline-block pl15px pr15px mr20px\"><img src='"+getRootPath_web()+"static/img/button_add.png'>新建</span>";
    str+="<span onclick='deleteNursingInfo()' class=\"white border-radius4 bgRed inline-block pl15px pr15px\"><img src='"+getRootPath_web()+"static/img/icon_delete.png' style=\"vertical-align: -3px;\">批量删除</span>";
    str+="</p>";
    str+="<p class=\"right\">";
    str+="<span>共有<em id='totalRecord' class=\"red fb ml5px mr5px\">0</em>条</span>";
    str+="</p>";
    str+="</div>";
    str+="<div class=\"border1px border-radius4 relative table-time\">";
    str+="<table class=\"layui-hide\" id=\"nursing\" lay-filter=\"nursing\"></table>";
    str+="</div>";
    str+="</div>"
    str+="</article>";
    str+="</div>";
    $("#containInfo").append(str);
    layui.use(['laydate'], function() {
        var laydate = layui.laydate;
        laydate.render({
            elem: '#startDate',
            trigger: 'click',
        });
        laydate.render({
            elem: '#endDate',
            trigger: 'click',
        });
    });
    obtainNursingData();
}
//查询护理评估数据
function obtainNursingData() {
    var userNo =$("#userNo").val();
    layui.use(['table' , 'layer'], function() {
        var table = layui.table;
        //第一个实例
        table.render({
            elem: '#nursing'
            ,url: getRootPath_web()+'/healthArchive/healthyNursing/obtainData',
            method:'post',
            where:{userNo:userNo},
            request: {
                pageName: 'pageNum' //页码的参数名称，默认：page
                ,limitName: 'pageSize' //每页数据量的参数名，默认：limit
            },
            parseData: function(res){
                return {
                    "code": res.code, //解析接口状态
                    "msg": res.codeDesc, //解析提示文本
                    "count": res.totalRecord, //解析数据长度
                    "data": res.data //解析数据列表
                };
            },
            done:function(res){
                $("#totalRecord").html(res.count);
            },
            page: true //开启分页
            ,
            cols: [
                [ //表头
                    {
                        type: 'checkbox',
                        fixed: 'left'
                    },
                    {
                        field: 'order',
                        title: '编号',
                        fixed: 'left',
                        width:80,
                    }, {
                    field: 'nursingName',
                    title: '护理评估等级',
                    },  {
                    field: 'nursingDate',
                    title: '护理评估日期',
                    },
                    {
                    field: 'name',
                    title: '记录员',
                    }, {
                        field: 'dateTime',
                        title: '记录时间',
                    }
                ]
            ]
        });
    });
}
//添加护理评估信息
function addNursingInfo() {
    var optionStr = "";
    $.ajax({
        url:getRootPath_web()+'baseData/fee/obtainFeeData',
        type:'post',
        dataType:'json',
        data:{"feeType":"102"},
        success:function (result) {
            var str="<div class=\"pop-up\">";
            str+="<div>";
            str+="<div class=\"pop-title relative overflow mb15px\">";
            str+="<span class=\"ml15px\">新建记录</span>";
            str+="<p class=\"right closeBtn\" style='cursor: pointer'><img src='"+getRootPath_web()+"static/img/close_icon.png' class=\"block pop-close\"><p>";
            str+="</div>";
            str+="<div class=\"pop-form mt30px mb30px\">";
            str+="<div class=\"layui-form-item\">";
            str+="<label class=\"layui-form-label\"><span class=\"red\">*</span>护理等级：</label>";
            str+="<div class=\"layui-input-block layui-input-block-two overflow\">";
            str+="<p>";
                str+="<select id='nursingDegree' class=\"layui-input form-input-pr\">";
                str+="<option value =\"\">--请选择护理等级--</option>";
                if(result.costCount>0){
                    $.each(result.data,function (key,value) {
                        str+="<option value='"+value.costNo+"'>--"+value.costName+"--</option>";
                    })
                }
                str+="</select>";
            str+="</p>";
            str+="</div>";
            str+="<div class=\"pop-form mt30px mb30px\">";
            str+="<div class=\"layui-form-item\">";
            str+="<label class=\"layui-form-label\"><span class=\"red\">*</span>评估时间：</label>";
            str+="<div class=\"layui-input-block\">";
            str+="<input id='nursingDate' type=\"text\" placeholder=\"请选择评估时间\" readonly class=\"layui-input diastolicPressure\">";
            str+="</div>";

            str+="</div>";
            str+="</div>";
            str+="<div class=\"btn-con textCenter\">";
            str+="<span class=\"btn-two btn-submit cursor\">保&nbsp;存</span>";
            str+="</div>";
            str+="</div>";
            str+="</div>";
            layui.use(['layer','laydate'], function() {
                var layer = layui.layer;
                layer.open({
                    type: 1,
                    title: false, //不显示标题栏
                    closeBtn: false,
                    area: ['500px', ''],
                    shade: 0.6,
                    id: 'payCons', //设定一个id，防止重复弹出
                    /*,btn: ['确认支付']*/
                    btnAlign: 'c',
                    moveType: 1, //拖拽模式，0或者1
                    shadeClose: false, //设置允许点遮罩关闭
                    content: str,
                    success: function() {
                        var laydate = layui.laydate;
                        laydate.render({
                            elem: '#nursingDate',
                            trigger: 'click',
                        });
                        //关闭弹层
                        $(".closeBtn").click(function() {
                            layer.closeAll();
                        });
                        $(".btn-submit").click(function () {
                            saveNursingInfo();
                        })
                    },
                });
            });
        }
    })
}
//保存护理评估记录信息
function saveNursingInfo() {
    layui.use('layer', function(){
        var layer = layui.layer;
        var userNo =$("#userNo").val();
        //护理等级
        var nursingDegree=$("#nursingDegree").val();
        if(nursingDegree==''){
            layer.msg('护理等级不能为空！');
            return false;
        }
        //评估日期
        var nursingDate=$("#nursingDate").val();
        if(nursingDate==''){
            layer.msg('评估日期不能为空！');
            return false;
        }
        var loading;
        // layer.confirm('确定添加吗？', {
        //     btn: ['确定','取消'] //按钮
        // }, function(){
        //
        // }, function(){
        //     layer.close(layer.index);
        // });
        $.ajax({
            url:getRootPath_web()
                +'healthArchive/healthyNursing/saveData',
            type:'post',
            data:{"userNo":userNo,"nursingDegree":nursingDegree,"nursingDate":nursingDate},
            dataType:'json',
            beforeSend:function () {
                loading = layer.load(1, {
                    shade: [0.9,'#fff']
                    ,shadeClose:false
                });
            },
            success:function (result) {
                if(result.code=='0000'){
                    layer.confirm('添加成功', {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.closeAll();
                        obtainNursingData();
                    })
                }else {
                    layer.confirm(result.codeDesc, {
                        btn: ['确定'] //按钮
                        ,shadeClose: false
                        ,closeBtn:false
                    }, function(){
                        layer.close(layer.index);
                        layer.close(loading);
                    })
                }
            }
        })
    });
}
//删除护理评估数据信息
function deleteNursingInfo(){
    layui.use('table', function(){
        var table = layui.table;
        var layer = layui.layer;
        //监听表格复选框选择
        table.on('checkbox(nursing)', function(obj){
            console.log(obj)
        });
        //获取选中的值
        var checkStatus = table.checkStatus('nursing')
            ,data = checkStatus.data;
        //获取选中的条数
        var dataLength = data.length;
        if(dataLength<=0){
            layer.msg("请选择要删除的数据！")
            return false;
        }
        var dateInfo = JSON.stringify(data);
        layer.confirm('确定删除这'+dataLength+'条记录吗？', {
            btn: ['确定','取消'] //按钮
        }, function(){
            $.ajax({
                url:getRootPath_web()
                    +'healthArchive/healthyNursing/deleteData',
                type:'post',
                data:{"dataInfo":dateInfo},
                dataType:'json',
                success:function (result) {
                    if(result.code=='0000'){
                        layer.confirm('删除成功？', {
                            btn: ['确定','取消'] //按钮
                        }, function(){
                            layer.closeAll();
                            obtainNursingData();
                        });
                    }else {
                        layer.msg(result.codeDesc);
                    }
                }
            })
        }, function(){
            layer.closeAll();
        });
    });
}

//返回到列表页
function returnToList() {
    window.location.href=getRootPath_web()
        +"healthArchive/elderly/oldManList";
}
//编辑健康档案
function updateOldManHealthyInfo() {
    var userNo =$("#userNo").val();
    window.location.href=getRootPath_web()+
        "healthArchive/elderly/addBaseHealthy?userNo="+userNo;
}
//查询护理详情
function nursingInfo() {
    layui.use(['layer'], function() {
        var layer = layui.layer;
        layer.open({
            type: 1,
            title: false, //不显示标题栏
            closeBtn: false,
            area: ["$('div#pop-con') + width() + 'px'", ''],
            shade: 0.6,
            id: 'payCons', //设定一个id，防止重复弹出
            /*,btn: ['确认支付']*/
            btnAlign: 'c',
            moveType: 1, //拖拽模式，0或者1
            shadeClose: true, //设置允许点遮罩关闭
            content: $("div#pop-con"),
            success: function() {
                //关闭弹层
                $(".pop-close").click(function() {
                    layer.closeAll();
                });
            },

        });
    });
}